home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / tools / installmodule < prev    next >
Text File  |  1993-10-29  |  852b  |  42 lines

  1. #! /bin/sh
  2.  
  3. # installmodule: installs binfile and initfile in module-directory
  4.  
  5. if [ "$3" = "" ] ; then
  6.   echo 'usage: installmodule binfile initfile module-directory'
  7.   exit 1
  8. fi
  9.  
  10. binfilepath=$1
  11. initfilepath=$2
  12. moduledir=$3
  13.  
  14. if [ ! -d "$moduledir" ]; then
  15.     # Make all necessary directories.
  16.     Ds="$moduledir"
  17.     D="$moduledir"
  18.     while
  19.     D=`expr "$D//" "\(.*\)/[^/]*//"`
  20.     test ! -d "$D"
  21.     do
  22.     Ds="$D $Ds"
  23.     done
  24.     mkdir "$Ds"
  25. fi
  26.  
  27.  
  28. binfile=`basename $binfilepath`
  29. initfile=`basename $initfilepath`
  30.  
  31. if [ -f $moduledir/$binfile ] ; then
  32.   /bin/rm $moduledir/$binfile
  33. fi
  34. if [ -f $moduledir/$initfile ] ; then
  35.   /bin/rm $moduledir/$initfile
  36. fi
  37. /bin/cp $initfilepath $binfilepath $moduledir
  38. # don't strip here, only strip when packing up for distribution
  39. # strip $moduledir/$binfile
  40. chmod 775 $moduledir/$binfile
  41. chmod 664 $moduledir/$initfile
  42.